package com.lcf.system.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import com.lcf.framework.config.enums.BaseEnum;
import lombok.Getter;

/**
 * 描述：内置角色
 *
 * @author lcf
 * @since 2025/3/2 22:23
 */
@Getter
public enum SysRoleEnum implements BaseEnum<String> {
    /**
     * 内置租户管理员角色
     */
    ADMIN("admin", "管理员");

    @EnumValue
    @JsonValue
    private final String code;
    private final String name;

    SysRoleEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static boolean isSysRole(String code) {
        for (SysRoleEnum roleEnum : values()) {
            if (roleEnum.getCode().equals(code)) {
                return true;
            }
        }
        return false;
    }
}
